<?php

class Tev_Controller_Crud extends Tev_Controller_Action
{
    public function indexAction()
    {
        $this->_redirect($this->_getParam('module') . '/' . $this->_getParam('controller') . '/list');
    }

    public function formAction()
    {

    }

    public function listAction()
    {
        $this->view->rowSet = $this->_getModel()->fetchAll(null, 'name');
    }

    protected function _getModel()
    {
        $modelName = $this->_getClassModel();
        return new $modelName;
    }

    protected function _getClassModel()
    {
        return ucfirst($this->_getParam('controller'));
    }
}